/**
 * 
 */
package com.zte.claa.inficombo.csa.app.service.rptparse.ext.comm.mina;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;
import org.apache.mina.filter.codec.textline.TextLineDecoder;

/**
 * @author 10024911
 *
 */
public class MinaMsgCodecFactory implements ProtocolCodecFactory {
	private TextLineDecoder decoder;
	private ProtocolEncoder encoder;
	
	/**
	 * 编解码器工厂
	 * 
	 * @param decoder
	 * @param encoder
	 */
	public MinaMsgCodecFactory(TextLineDecoder decoder, ProtocolEncoder encoder){
		this.decoder = decoder;
		this.encoder = encoder;
	}

	@Override
	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return this.encoder;
	}

	@Override
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return this.decoder;
	}
}
